home *** CD-ROM | disk | FTP | other *** search
/ Die Speccy' 97 / Die Speccy' 97.iso / amiga_system / the_aminet / util / rexx / tritonrexx376.lha / TritonRexx / Programme / Break.rexx < prev    next >
OS/2 REXX Batch file  |  1995-09-17  |  4KB  |  161 lines

  1. /*
  2.    $VER: Break.rexx Demo (13.9.95)   Copyright in 1995 by Nils Goers
  3.  
  4.   This small Script is a Demo to inspirate you ;) I'm to lazy to
  5.   create a better GUI. This GUI is quite enough for me, for you too ??
  6.  
  7. */
  8.  
  9. OutFile = "t:Statusliste"
  10. Status = "Status full"
  11. Break  = "Break"
  12.  
  13. FALSE = 1
  14. TRUE  = 0
  15. PARSE ARG PubScreen
  16.  
  17. _main:
  18. IF PubScreen == "?" THEN DO
  19.  OPTIONS PROMPT "PUBSCREEN/K: "
  20.  PARSE PULL PubScreen
  21. END
  22.  
  23. IF PubScreen == "" THEN
  24.    PubScreen  = "Workbench"
  25.  
  26. IF ~SHOW('LIBRARIES','tritonrexx.library') THEN DO
  27.    IF ~ADDLIB('tritonrexx.library',10,-30,0) THEN DO
  28.       SAY 'Kann die <tritonrexx.library> nicht oeffnen!'
  29.       EXIT(10)
  30.    END
  31. END
  32.  
  33. IF ~SHOW('LIBRARIES','rexxtricks.library') THEN DO
  34.    IF ~ADDLIB('rexxtricks.library',10,-30,0) THEN DO
  35.       SAY 'Kann die <rexxtricks.library> nicht oeffnen!'
  36.       EXIT(10)
  37.    END
  38. END
  39.  
  40. call initListe
  41. call initWindow
  42.  
  43.  
  44. quitprogram = FALSE
  45. _loop:
  46. DO WHILE quitprogram = 1
  47.   CALL TR_WAIT(app,'')
  48.  
  49.          DO WHILE TR_HANDLEMSG(app,'event')
  50.             IF event.trm_class = 'TRMS_NEWVALUE' THEN DO
  51.              IF event.trm_id = 1 THEN DO
  52.              nummer=TR_GETATTRIBUTE(window,1,TRAT_Value)+1
  53.              ShowName = DELWORD(liste.nummer,1,4)
  54.              IF ShowName = "" THEN ShowName = "Unnamed"
  55.              CALL TR_SETATTRIBUTE(window,80,'TRAT_Text',ShowName)
  56.              END
  57.             END
  58.  
  59.             IF event.trm_class = 'TRMS_ACTION' THEN DO
  60.              IF event.trm_id = 2 THEN CALL BREAKC
  61.              IF event.trm_id = 3 THEN CALL BREAKD
  62.              IF event.trm_id = 4 THEN CALL BREAKE
  63.              IF event.trm_id = 5 THEN CALL BREAKF
  64.              IF event.trm_id = 6 THEN CALL BREAKALL
  65.              IF event.trm_id = 7 THEN DO
  66.                CALL initListe
  67.                CALL TR_SETATTRIBUTE(window,1,'TROB_Listview',Liste)
  68.              END
  69.             END
  70.  
  71.  
  72.             IF event.trm_class = 'TRMS_CLOSEWINDOW' THEN DO
  73.                nummer = TR_GETATTRIBUTE(window,10,'TRAT_Value')+1
  74.                quitprogram = TRUE
  75.  
  76.             END
  77.          END
  78. END
  79.       CALL TR_CLOSEPROJECT(window)
  80.    CALL TR_DELETEAPP(app)
  81.  
  82. EXIT
  83.  
  84. initWindow:
  85. windowtags =   WindowID(1),
  86.                PubScreenName(PubScreen),
  87.                WindowTitle('Break.rexx   1995 by Nils Goers'),
  88.                'HorizGroupA Space',
  89.                'VertGroupA Space',
  90.                Text3('P: Stack: gv: pri: Loaded as command:'),
  91.                ListSelCN('Liste',1,0),
  92.                ClippedTextBox("",80) 'Space',
  93.                'HorizGroupA',
  94.                Button('CTRL-C',2),
  95.                Button('CTRL-D',3),
  96.                Button('CTRL-E',4),
  97.                Button('CTRL-F',5),
  98.                Button('ALL',6),
  99.                GetEntryButton(7),
  100.                'EndGroup EndGroup Space EndGroup',
  101.                'EndProject'
  102.  
  103. app = TR_CREATEAPP('TRCA_Name Listview')
  104. IF app ~= '00000000'x THEN DO
  105.    window = TR_OPENPROJECT(app,windowtags)
  106.    WindowProject=C2D(window) /* zum Locken des Fensters bei About */
  107.  
  108.    IF window ~= '00000000'x THEN quitprogram = TRUE
  109. END
  110. RETURN
  111.  
  112. initListe:
  113. ADDRESS COMMAND Status ">"OutFile
  114. IF READFILE(Outfile,liste) == 0 THEN EXIT(5)
  115. ADDRESS COMMAND "delete "Outfile "QUIET"
  116. DO i = 1 to liste.0
  117.  
  118. liste.i= DELWORD(liste.i,1,1)
  119. liste.i= DELWORD(liste.i,2,1)
  120. liste.i= DELWORD(liste.i,3,1)
  121. liste.i= DELWORD(liste.i,4,1)
  122. liste.i= DELWORD(liste.i,5,3)
  123. END
  124. RETURN
  125.  
  126. BREAKC:
  127. ToolType = "C"
  128. CALL DoIt
  129. RETURN
  130.  
  131. BREAKD:
  132. ToolType = "D"
  133. CALL DoIt
  134. RETURN
  135.  
  136. BREAKE:
  137. ToolType = "E"
  138. CALL DoIt
  139. RETURN
  140.  
  141. BREAKF:
  142. ToolType = "F"
  143. CALL DoIt
  144. RETURN
  145.  
  146. BREAKALL:
  147. ToolType = "ALL"
  148. CALL DoIt
  149. RETURN
  150.  
  151. DoIt:
  152. ToolName = WORD(Liste.nummer,1); ToolName=COMPRESS(Toolname,":")
  153. IF ToolName = "LISTE.NUMMER" THEN RETURN
  154. ADDRESS COMMAND Break ToolName ToolType
  155. ADDRESS COMMAND "wait"
  156. CALL initListe
  157. CALL TR_SETATTRIBUTE(window,1,'TROB_Listview',Liste)
  158. CALL TR_SETATTRIBUTE(window,80,'TRAT_Text'," ")
  159. RETURN
  160. /*EOS*/
  161.